@extends('admin.index')

@section('title','用户列表')

@section('content')
    <style>
    #pages li{
        float: left;
        height: 20px;
        padding: 0 10px;
        display: block;
        font-size: 12px;
        line-height: 20px;
        text-align: center;
        cursor: pointer;
        outline: none;
        background-color: #444444;
        color: #fff;
        text-decoration: none;
        border-right: 1px solid #232323;
        border-left: 1px solid #666666;
        border-right: 1px solid rgba(0, 0, 0, 0.5);
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5), inset 0px 1px 0px rgba(255, 255, 255, 0.15);
        -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5), inset 0px 1px 0px rgba(255, 255, 255, 0.15);
        box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5), inset 0px 1px 0px rgba(255, 255, 255, 0.15);
    }
    #pages .active{
        background-color: #c5d52b;
    }
    #pages .active span{
        color:black;
    }

    #pages {
        height:auto;
        overflow:hidden;
        margin:0px;
        padding:0px;
    }

    .pagination{
        padding:0px;
        margin:0px;
    }
</style>

<div class="mws-panel grid_8">
                	<div class="mws-panel-header">
                    	<span><i class="icon-table"></i><font><font> 用户分页表</font></font></span>
                    </div>
                    <div class="mws-panel-body no-padding">
                      <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
                    	<form action="" >
	                    	<div id="DataTables_Table_1_length" class="dataTables_length">
	                        <label><font><font>每页 </font></font>
		                        <select size="1" name="num" aria-controls="DataTables_Table_1">
		                        	<option value="10" @if(!empty($data['num']) && $data['num'] ==10) selected @endif "><font><font>10</font></font></option>
		                        	<option value="25" @if(!empty($data['num']) && $data['num'] == 25) selected @endif ><font><font>25</font></font></option>
		                        	<option value="50" @if(!empty($data['num']) && $data['num'] == 50) selected @endif ><font><font>50</font></font></option>
		                        	<option value="100" @if(!empty($data['num']) && $data['num'] == 100) selected @endif ><font><font>100</font></font></option>
		                        </select><font><font> 条</font></font>
		                    </label>
		                	</div>	
			                <div class="dataTables_filter" id="DataTables_Table_1_filter">
			                    <label><font><font>关键字： </font></font>
			                    <input type="text" name="keywords" value="{{$data['keywords'] or ''}}" aria-controls="DataTables_Table_1"></label> 
			                    <button class="btn btn-info btn-xs" type="submit">搜索</button>
			                </div>
	                	</form>
	                <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                            <thead>
                                <tr role="row"><th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 175px;"><font><font>ID</font></font></th><th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 328px;"><font><font>用户</font></font></th><th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 309px;"><font><font>邮箱</font></font></th><th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 223px;"><font><font>头像</font></font></th><th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 260px;"><font><font>操作</font></font></th></tr>
                            </thead>
                            
                        <tbody role="alert" aria-live="polite" aria-relevant="all">
                        	@foreach($users as $k=>$v)
                    		<tr class="@if($k % 2 == 0) odd @else even @endif ">
                                <td class=" sorting_1"><font><font>{{$v['id']}}</font></font></td>
                                <td class=" "><font><font>{{$v['username']}}</font></font></td>
                                <td class=" "><font><font>{{$v['email']}}</font></font></td>
                                <td class=" "><font><font><img src="{{$v['img']}}" style="width:70px"></font></font></td>
                                <td class=" "><font><font>
                                   
                                	<a class="btn btn-info btn-sm" style="float:left" href="/user/{{$v['id']}}/edit">修改</a>
                                    <form action="/user/{{$v['id']}}" method="post">
                                        <input type="hidden" name="_method" value="delete">
                                        {{csrf_field()}}
                                        <button class="btn btn-danger btn-sm" style="float:left" type="">删除</button>
                                    </form></font></font>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                    
                    	<div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_1_paginate">
                    		
                    	
                    		<div id= 'pages'>
                    		{!! $users->appends($data)->render() !!}
                    	</div>
                    	</div>
                    </div>
                    </div>
                </div>
                    
@endsection('content');